#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<cstdlib>
#include<cmath>
#include<sstream>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<stack>
#define PI acos(-1)
#define MP make_pair
#define PB push_back
#define VI vector <int>
#define PII pair <int,int>
#define LL long long
#define SET(v,i) memset(v, i, sizeof(v))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORD(i,a,b) for (int i = (a); i >= (b); i--)
#define FORN(i,a,b) for (int i = (a); i < (b); i++)
#define DOWN(i,a,b) for (int i = (a); i > (b); i--)
#define FIT(it,v) for (typeof(v.begin()) it = v.begin(); it != v.end(); it++)
#define FITD(it,v) for (typeof(v.rbegin()) it = v.rbegin(); it != v.rend(); it++)
using namespace std;
const int N=1005;
double dp[N][N],f[N][N],c[N][N];
vector<int>v[N],w;
int main(){
	c[0][0]=1;
	for(int i=1;i<N;i++){
		c[i][0]=1;
		for(int j=1;j<=i;j++)c[i][j]=c[i-1][j]+c[i-1][j-1];
		}
		int a=+'c';
	int n,m;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int x,y;
		cin>>x;
		for(int j=0;j<x;j++){
			cin>>y;
			v[i].push_back(y);
			w.push_back(-y);
			}
		}	
	sort(w.begin(),w.end());
	
	dp[0][0]=f[0][0]=1;
	for(int i=0;i<m;i++){
		int x=0,y=0;
		for(int j=0;j<v[i].size();j++){
			if(v[i][j]>-w[n-1])x++;//must take
			else if(v[i][j]==-w[n-1])y++;//choose
			}
			
		for(int j=0;j<=n;j++){
			for(int k=0;k<=y&&j+x+k<=n;k++){
				f[i+1][j+x+k]+=f[i][j];
				//cout<<"f["<<i+1<<"]["<<j+x+k<<"]="<<f[i+1][j+x+k]<<" "<<"f["<<i<<"]["<<j<<"]="<<f[i][j]<<endl;
				dp[i+1][j+x+k]+=dp[i][j]/c[v[i].size()][x+k];
				}
			}	
		}
	printf("%.10lf\n",dp[m][n]/f[m][n]);while(1);	
    return 0;
    }
/*
3 1
3 10 20 30
*/
